package les.anagrama;

import java.util.List;

import les.anagrama.util.Level;
import les.anagrama.util.Score;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Ranking extends Activity {
	private List<Score> scores;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ranking);

		les.anagrama.util.Ranking ranking = new les.anagrama.util.Ranking(this);
		scores = ranking.getScores((Level) getIntent().getExtras()
				.getSerializable("level"));

		ListView listView = (ListView) findViewById(R.id.listView1);
		listView.setAdapter(new ArrayAdapter<Score>(this,
				android.R.layout.simple_list_item_1, scores));
	}
}
